﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Xml;
using System.Net.Sockets;
using System.IO;
using Conexion;

namespace Admin
{
    public partial class AdminForm : Form
    {
        private RequestManager requestService = null;
        private Config conf = null;
        private const string CMD_AGREGAR = "01";
        private const string CMD_QUITAR = "02";

        public AdminForm()
        {
            InitializeComponent();
         
            //  Carga la configuracion del XML del Cliente
            conf = new Config(""); 

            // Inicio el servicio para enviar comandos a los servidiores
            requestService = new RequestManager(conf, this);

        }

        private void btnAgregar_Click(object sender, EventArgs e)
        {
            lblResultado.ForeColor = Color.Black;
            requestService.ConsultarManager(CMD_AGREGAR);
        }

        private void btnQuitar_Click(object sender, EventArgs e)
        {            
            lblResultado2.ForeColor = Color.Black;
            requestService.ConsultarManager(CMD_QUITAR);         
        }


        #region //Func auxiliares de GUI


        private void agregarServidorToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            grpQuitar.Visible = false;
            grpAgregar.Visible = true;
        }

        private void quitarServidorToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            this.Controls.Add(this.grpQuitar);
            grpAgregar.Visible = false;
            grpQuitar.Visible = true;
        }

        private void salirToolStripMenuItem_Click_1(object sender, EventArgs e)
        {
            this.Close();
        }

        #endregion

    }
}
